package state.fromCsdn.impl;

import state.fromCsdn.Account;
import state.fromCsdn.AccountState;

/**
 * 受限状态
 */
public class RestrictedState extends AccountState {
    public RestrictedState(Account acc) {
        this.acc = acc;
    }
    @Override
    public void deposit(Double amount) {
        acc.setBalance(acc.getBalance() + amount);
    }

    @Override
    public void withdraw(Double amount) {
        System.out.println("操作受限");
    }

    @Override
    public void computeInterest() {
        System.out.println("计算利息");
    }
}
